import { ys } from "ys-ts";
import { nameApiAxios } from "../plugins/axios/init";
import { IResponseData } from "ys-ts/dist/types";

export function useApiProject() {
  const apiUtil = ys.getApiUtil(
    "department",
    ys.getAxios(nameApiAxios),
    "/project"
  );

  function save() {
    return apiUtil.getWithApiConfig<IResponseData<string>>("/save", {});
  }

  function reload() {
    return apiUtil.getWithApiConfig<IResponseData<string>>("/reload", {});
  }

  return {
    save,
    reload,
  };
}
